// 车险 核保驳回
import Vue from 'vue'
import {store} from '@/store/index'
import textarea from '@/components/ivew_components/examine_reject/index.vue'
import commonFn from './common_fn.ts'


let vueObj:any = new Vue()

 const conf = {
    title: '核保驳回',
    icon: 'icon-error-r',
    pag: 'carExamineReject',
    fn (){
        let orderData =  store.state['carFormStore']['orderData'];
        let text = {message: ''};
        
        vueObj.$Modal.confirm({

            render (h){
                return h(textarea, {
                    props:{
                        data:text,
                        dataKey: 'message'
                    }
                })
            },
            onOk (){
                store. dispatch('request', {
                    url: 'patch/order/id/status',
                    data:{
                        currentAction: '撤回核保',
                        message: text.message,
                    }
                }).then(success =>{

                    vueObj.$Notice.success({
                        title: '撤回成功'
                    })

                    // 延时关闭表单折叠层
                    setTimeout(() =>{
                        commonFn('updateTable','outForm')
                    }, 500)
                    
                })
            }            
        })
        
    }
    
        
     
 };

 export default conf;